import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {SERVER_URL} from '../../config';

@Component({
  selector: 'app-qrcode',
  templateUrl: './qrcode.component.html',
  styleUrls: ['./qrcode.component.css']
})
export class QrcodeComponent implements OnInit {
  value = 'https://www.wenchiren.top/foodtracer/dist/#/public/trace';
  batch: string;
  batchId: string;
  constructor(private route: ActivatedRoute) {
    this.route.queryParams.subscribe(params => {
      this.batch = params['batch'];
      this.batchId = params['batchId'];
      console.log(this.batchId);
      this.value = this.value + '?batch=' + this.batchId;
    });
  }

  ngOnInit() {
  }
  submit() {
    console.log(this.batch);
  }
}
